import type { CommonAPI } from '@/apis/types/all.ts'
import { defHttp } from '@/apis/http'

/**
 * @description: MachineGroup
 */

/** 分组详情 */
export const getComputeMachineGroupDetailApi: CommonAPI<
  '/v1/compute/machine_group',
  'get'
> = params => defHttp.get(`/v1/compute/machine_group`, { params })

/** 删除分组 */
export const deleteComputeMachineGroupApi: CommonAPI<
  '/v1/compute/machine_group',
  'delete'
> = data => defHttp.delete(`/v1/compute/machine_group`, { data })

/** 创建分组 */
export const addComputeMachineGroupApi: CommonAPI<
  '/v1/compute/machine_group',
  'post'
> = data => defHttp.post(`/v1/compute/machine_group`, data)

/** 更新分组 */
export const updateComputeMachineGroupApi: CommonAPI<
  '/v1/compute/machine_group',
  'put'
> = data => defHttp.put(`/v1/compute/machine_group`, data)

/** 分组列表 */
export const getComputeMachineGroupListApi: CommonAPI<
  '/v1/compute/machine_group/list',
  'get'
> = params => defHttp.get(`/v1/compute/machine_group/list`, { params })

/** 更新分组状态 */
export const updateComputeMachineGroupStatusApi: CommonAPI<
  '/v1/compute/machine_group/status',
  'post'
> = data => defHttp.post(`/v1/compute/machine_group/status`, data)
